import requests as requests

from utils.log_utils import logger


class HttpProtocol:
    @classmethod
    def request(self, method, url, **kwargs):
        logger.info(f"请求的参数为{method}，url为{url}，其它参数为{kwargs}")
        r = requests.request(method=method,url=url,**kwargs)
        #如果响应结果都是json，那么可以直接返回r.json
        logger.info(f"接口的响应内容为{r.json()}")
        return r.json()

